package edu.rpi.tw.pml.browsing.client.util;

import java.util.ArrayList;

import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Element;


/*
 * Helper class to parse XML string.
 */
public class XMLParser {

	/*
	 * Parse XML texts to an concept array.
	 */
	public static ArrayList<String> string2ConceptArray(String xmlText) {
		ArrayList<String> list = new ArrayList<String>();
	
		Document xmlDoc = com.google.gwt.xml.client.XMLParser.parse(xmlText);
		Element docElement = xmlDoc.getDocumentElement();
		com.google.gwt.xml.client.XMLParser.removeWhitespace(docElement);
		docElement.getElementsByTagName("results").item(0);
		return list;
	}
}
